package com.qfoud.edu.shiro.framwork.pojo;


import com.qfoud.edu.shiro.framwork.result.LoginResultNotify;
import com.qfoud.edu.shiro.framwork.service.base.UserDetailService;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author xiaobobo
 * @title: Context
 * @projectName cd-java-2303-project-parent
 * @description: 这个是上下文的东西
 * @date 2023/5/11  15:51
 */
public class Context {

    //这个就是用户用来查询数据库的类
    private static UserDetailService userDetailService=null;

    private static LoginResultNotify loginResultNotify=null;

    //存放方法需要访问权限或者角色的这样一个集合
    private static Map<String, List<String>> rolesAndPerms=new ConcurrentHashMap<>();

    public static Map<String, List<String>> getRolesAndPerms() {
        return rolesAndPerms;
    }

    public static void setLoginResultNotify(LoginResultNotify loginResultNotify) {
        Context.loginResultNotify = loginResultNotify;
    }

    public static LoginResultNotify getLoginResultNotify() {
        return loginResultNotify;
    }

    public static void setUserDetailService(UserDetailService userDetailService) {
        Context.userDetailService = userDetailService;
    }

    public static UserDetailService getUserDetailService() {
        return userDetailService;
    }
}
